var CompanySite = {
	editSite: function(idsite) {
		$.facebox(function() {
			ajax({
			  url: baseURL + "company/site/edit/" + idsite,
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) { $.facebox(data) }
			});
		});
		
		return false;
	},
	
	processSite: function() {
		ajax({
		  url: baseURL + "company/site/" + ($('#idsite').val() ? 'update' : 'insert'),
		  cache: false,
		  type: "POST",
		  data: $('#ajax_form').serialize(),
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	deleteSite: function(idsite) {
		ajax({
		  url: baseURL + "company/site/delete",
		  cache: false,
		  type: "POST",
		  data: 'id=' + idsite,
		  async: false,
		  dataType: 'script'
		});
		
		return false;
	},
	
	getSiteGrid: function() {
		ajax({
			  url: baseURL + "company/site",
			  cache: false,
			  type: "POST",
			  data: $('#ajax_form').serialize(),
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#gridSite').html(data);
			  }
			});
	},
	
	getSiteType: function() {
		ajax({
			  url: baseURL + "ajax/get_site_type",
			  cache: false,
			  type: "POST",
			  async: false,
			  dataType: 'html',
			  success: function(data) {
				  $('#siteType').html(data);
			  }
			});
	}
}